<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/

get_config_keytable("user_views_");
empty($do) && $do = 'list';
if ($do == 'edit') {
	$id = getGP('userid','G','int');
	$rs = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."user a,".DB_TABLEPRE."user_view b WHERE a.id=b.uid and a.id=".$id."");
	include_once('template/file_edit.php');

}elseif ($do == 'save') {
	
	$savetype = getGP('savetype','P');
	$id = getGP('id','P','int');
	$user = array(
		'departmentid' => getGP('departmentid','P')
	);
	$user_view = array(
		'number' => getGP('number','P'),
		'labornumber' => getGP('labornumber','P'),
		'name' => getGP('name','P'),
		'enname' => getGP('enname','P'),
		'idcard' => getGP('idcard','P'),
		'birthdate' => getGP('birthdate','P'),
		'age' => getGP('age','P'),
		'sex' => getGP('sex','P'),
		'nativeplace' => getGP('nativeplace','P'),
		'nationality' => getGP('nationality','P'),
		'marriage' => getGP('marriage','P'),
		'health' => getGP('health','P'),
		'politics' => getGP('politics','P'),
		'partydate' => getGP('partydate','P'),
		'regtype' => getGP('regtype','P'),
		'regaddress' => getGP('regaddress','P'),
		'photo' => getGP('photo','P'),
		'worktype' => getGP('worktype','P'),
		'administration' => getGP('administration','P'),
		'stafftype' => getGP('stafftype','P'),
		'position' => getGP('position','P'),
		'title' => getGP('title','P'),
		'dutydate' => getGP('dutydate','P'),
		'jobseniority' => getGP('jobseniority','P'),
		'startingpay' => getGP('startingpay','P'),
		'inoffice' => getGP('inoffice','P'),
		'sumseniority' => getGP('sumseniority','P'),
		'participationwork' => getGP('participationwork','P'),
		'tel' => getGP('tel','P'),
		'phone' => getGP('phone','P'),
		'fax' => getGP('fax','P'),
		'email' => getGP('email','P'),
		'address' => getGP('address','P'),
		'qq' => getGP('qq','P'),
		'contact' => getGP('contact','P'),
		'schoolrecord' => getGP('schoolrecord','P'),
		'degree' => getGP('degree','P'),
		'draduationdate' => getGP('draduationdate','P'),
		'draduationschool' => getGP('draduationschool','P'),
		'specialized' => getGP('specialized','P'),
		'level' => getGP('level','P'),
		'language1' => getGP('language1','P'),
		'language2' => getGP('language2','P'),
		'language3' => getGP('language3','P'),
		'level1' => getGP('level1','P'),
		'level2' => getGP('level2','P'),
		'level3' => getGP('level3','P'),
		'specialskill' => getGP('specialskill','P'),
		'appendix' => getGP('appendix','P'),
		'resume' => getGP('resume','P')
	);
	update_db('user',$user, array('id' => $id));
	update_db('user_view',$user_view, array('uid' => $id));
	if($id!='')
	{
   $oalog = array(
		'uid' => $_USER->id,
		'content' => getGP('name','P'),
		'title' => '修改档案信息'.$name,
		'startdate' => get_date('Y-m-d H:i:s',PHP_TIME),
		'contentid' => $id,
		'type' => '3'
	);
	insert_db('oalog',$oalog);
	}
	goto_page('admin.php?ac=file&fileurl=user&userid='.$id.'');
	

}

?>